<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
<link rel="stylesheet" href="../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<script type="text/javascript" src="。。/js/bootstrap-3.3.7-dist/js/bootstrap.min.js" ></script>
<script type="text/javascript" src="../js/bank.js"></script>
<script type="text/javascript" src="../js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="../js/plugins/jquery.twbsPagination.min.js"></script>
<script type="text/javascript" src="../js//WdatePicker.js" ></script>
<link type="text/css" rel="stylesheet" href="../css/account.css" />

<html>

	<head>
		<meta charset="UTF-8">
		<title>p2p互联网金融平台后台管理</title>
		<script type="text/javascript">
		function toPage(page) {
            $("#myform").attr("action","../p2p/selectIpLog?currPage="+page+"&type"+${"[name='type']"}+"&userName"+${"[name='userName']"});
            //$("#myform").attr("action","../p2p/selectIpLog?currPage="+page+"&type="+${check}+"&userName="+${userName});
            $("#myform").submit();
        }
		
		$(function() {
            //拿到当前页
            var currPage = ${page.currPage};
            //拿到最后一页
            var totalPages = ${page.totalPages};

            if (currPage <= 1) {
                $("#prev").attr("disabled","disabled");
            }

            if (currPage >= totalPages) {
            	$("#next").attr("disabled","disabled");
            }
        });
		</script>
	</head>

<body>
	<div class="container">
		<div class="navbar cm-navbar">
			<img class="logo" alt="Brand" src="/images/logo.png">
			<span class="pageTitle">&nbsp;</span>
			<ul class="nav navbar-nav navbar-right cm-navbar-nav">
				<li>
					<c:if test="${sessionScope.user.userName!=null}">
						<p class="navbar-text text-info">${sessionScope.user.userName}</p>
					</c:if>
				</li>
				<li>
					<a href="">安全退出</a>
				</li>
				<li>
					<a href="">个人设置</a>
				</li>
			</ul>
		</div>
		<div class="row">
			<div class="col-sm-3">
				<ul id="menu" class="list-group">

					<li class="list-group-item">
						<a href="#" data-toggle="collapse" data-target="#permissionmanage_detail"><span>安全管理</span></a>
						<ul class="in" id="permissionmanage_detail">
							<li class="systemDictionary">
								<a href="../p2p/toDictionary2"><span>系统数据字典目录</span></a>
							</li>
							<li class="systemDictionaryItem">
								<a href="../p2p/toDictionaryItem"><span>系统数据字典明细</span></a>
							</li>
							<li class="ipLog">
								<a href="../p2p/toIpLog"><span>登录历史</span></a>
							</li>
						</ul>
					</li>
					<li class="list-group-item">
						<a href="#" data-toggle="collapse" data-target="#auditmanage_detail">
							<span>审核项目</span>
						</a>
						<ul class="in" id="auditmanage_detail">
							<li class="realAuth">
								<a href="./realAuth.do">实名认证审核</a>
							</li>
							<li class="vedioAuth">
								<a href="./vedioAuth.do">视频认证审核</a>
							</li>
							<li class="userFileAuth">
								<a href="./userFileAuth.do">认证材料审核</a>
							</li>
							<li class="bidrequest_publishaudit_list">
								<a href="./bidrequest_publishaudit_list.do">发标前审核</a>
							</li>
							<li class="bidrequest_audit1_list">
								<a href="./bidrequest_audit1_list.do">满标一审</a>
							</li>
							<li class="bidrequest_audit2_list">
								<a href="./bidrequest_audit2_list.do">满标二审</a>
							</li>
							<li class="rechargeOffline">
								<a href="./rechargeOffline.do">线下充值审核</a>
							</li>
							<li class="moneyWithdraw">
								<a href="./moneyWithdraw.do">提现审核</a>
							</li>
						</ul>
					</li>
					<li class="list-group-item">
						<a href="#" data-toggle="collapse" data-target="#systemmanage_detail">
							<span>平台管理</span>
						</a>
						<ul class="in" id="systemmanage_detail">
							<li class="companyBank">
								<a href="./companyBank_list.do">平台账号管理</a>
							</li>
							<li>
								<a href="./real_auth_list.do">系统账户流水</a>
							</li>
						</ul>
					</li>
				</ul>

				<script type="text/javascript">
					$(".in li.ipLog").addClass("active");
				</script>
			</div>
			<div class="col-sm-9">
				<div class="page-header">
					<h3>登陆历史</h3>
				</div>
				<form id="myform" action="../p2p/selectIpLog" method="post">
					查询用户名:
					<input type="text" name="userName" value="${userName}" />
					<select name="type" >
						<c:if test="${check!=null}">
							<option value="-1" <c:if test="${check==-1}">selected="selected"</c:if>>全部</option>
							<option value="0" <c:if test="${check==0}">selected="selected"</c:if>>用户</option>
							<option value="1" <c:if test="${check==1}">selected="selected"</c:if>>管理员</option>
						</c:if>
						<c:if test="${check==null}">
							<option value="-1">全部</option>
							<option value="0">用户</option>
							<option value="1">管理员</option>
						</c:if>
						
					</select>
					<button class="btn btn-success" type="submit">查询</button>
				</form>
				<table class="table">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th>用户名</th>
                          <th>ip</th>
                          <th>身份</th>
                          <th>登陆时间</th>
                        </tr>
                      </thead>
                      <tbody>
                      	  <c:forEach items="${list}" var="l">
							<tr>
                          		<th scope="row">${l.ilid }</th>
                         		<th scope="row">${l.userInfo.userName }</th>
                          		<th scope="row">${l.idIp }</th>
                          		<%-- <th scope="row">${l.userInfo.loginType}</th> --%>
                          		<c:if test="${l.userInfo.loginType == 0}">
                          			<th scope="row">用户</th>
                          		</c:if>
                          		<c:if test="${l.userInfo.loginType == 1}">
                          			<th scope="row">管理员</th>
                          		</c:if>
                          		<th scope="row">${l.loginTime }</th>
                        </tr>
						  </c:forEach>
                        
                      </tbody>
                    </table>
                    <div>
						<c:out value="${page.currPage}" />
						/
						<c:out value="${page.totalPages}" />
					</div>
					<div id="page" class="btn-group  btn-group-sm">
						<button class="btn btn-default" type="button" onclick="toPage(1)">首页</button>
						<button id="prev" class="btn btn-default" type="button"
							onclick="toPage(${page.currPage-1 })">上一页</button>
						<button id="next" class="btn btn-default" type="button"
							onclick="toPage(${page.currPage+1 })">下一页</button>
						<button class="btn btn-default" type="button"
							onclick="toPage(${page.totalPages})">尾页</button>
					</div>
			</div>
		</div>

	</div>

</body>

</html>